diff options
| author | Jay V <[email protected]> | 2025-06-10 11:52:02 -0500 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-06-10 11:52:02 -0500 |
| commit | 0e58f488df63f2143fdc5efa9ea85b1751bf7c10 (patch) | |
| tree | b5cbbce129948e96987910d6132ea541c8e9da86 /packages/web/src/pages/s/[id].astro | |
| parent | fa7416687bfe67d47b187c5b9c0dc8a5d2a95781 (diff) | |
| download | opencode-0e58f488df63f2143fdc5efa9ea85b1751bf7c10.tar.gz opencode-0e58f488df63f2143fdc5efa9ea85b1751bf7c10.zip | |
moving share urls
Diffstat (limited to 'packages/web/src/pages/s/[id].astro')
| -rw-r--r-- | packages/web/src/pages/s/[id].astro | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/packages/web/src/pages/s/[id].astro b/packages/web/src/pages/s/[id].astro new file mode 100644 index 000000000..523fa7e6c --- /dev/null +++ b/packages/web/src/pages/s/[id].astro @@ -0,0 +1,58 @@ +--- +import config from "virtual:starlight/user-config"; + +import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; +import Share from "../../components/Share.tsx"; + +const apiUrl = import.meta.env.VITE_API_URL; + +const { id } = Astro.params; +const res = await fetch(`${apiUrl}/share_data?id=${id}`); +const data = await res.json(); + +const title = data.info.title; +const ogImage = data.ogImage; + +--- +<StarlightPage + hasSidebar={false} + frontmatter={{ + title: title, + pagefind: false, + template: "splash", + tableOfContents: false, + head: [ + { + tag: "meta", + attrs: { + property: "og:image", + content: ogImage, + }, + }, + { + tag: "meta", + attrs: { + name: "twitter:image", + content: ogImage, + }, + }, + ], + }} +> + <Share + id={id} + api={apiUrl} + info={data.info} + messages={data.messages} + client:only="solid" + /> +</StarlightPage> + +<style is:global> +body > .page > .main-frame .main-pane > main > .content-panel:first-of-type { + display: none; +} +body > .page > .main-frame .main-pane > main > .content-panel + .content-panel { + border-top: none !important; +} +</style> |
